<template>
  父组件
  <button @click="btnClick" ref="btnRef">点击</button>
  <hr />
  <div>
    <Son ref="sonRef"></Son>
  </div>
</template>

<script>
import Son from './Son.vue'
export default {
  components: { Son },
  data() {
    return {
      isShow: false,
    }
  },
  methods: {
    hello() {
      console.log('hellowTest')
    },
    btnClick() {
      console.log(this.$refs.sonRef, this.$refs.btnRef)
      this.$refs.sonRef.hello()
      console.log(this.$refs.sonRef.$el)
    },
  },
}
</script>

<style scoped></style>
